﻿using System;
using System.Collections.Generic;
using HR60_PanelSoft.Model.BaseModel;

namespace HR60_PanelSoft.Model
{
	/// <summary>
	/// 面板
	/// </summary>
	public class Panel : RefModel
	{
		/// <summary>
		/// 名称
		/// </summary>
		public string name = "";

		/// <summary>
		/// 面板序号
		/// </summary>
		public int index = 0;

		/// <summary>
		/// 类型
		/// </summary>
		public PanelType type = null;

		/// <summary>
		/// 外部信号常量
		/// </summary>
		public Signal signal = null;

		/// <summary>
		/// 界面风格
		/// </summary>
		public UIStyle style = UIStyle.NULL;

		/// <summary>
		/// 负载线路列表
		/// </summary>
		public List<LoadPin> loadPins = new List<LoadPin>();

		/// <summary>
		/// 485线路
		/// </summary>
		public M485Pin m485Pin = null;

		/// <summary>
		/// E++类型
		/// </summary>
		public EplusType eplusType = EplusType.NULL;
		
		/// <summary>
		/// 下辖按钮页面
		/// </summary>
		public List<PanelPage> pages = new List<PanelPage>();

		/// <summary>
		/// 下辖场景页面
		/// </summary>
		public List<PanelPage> scenePages = new List<PanelPage>();

		/// <summary>
		/// 空调控制页面
		/// </summary>
		public ExPanelPage airconPage = null;

		/// <summary>
		/// 新风控制页面
		/// </summary>
		public ExPanelPage newWindPage = null;

		/// <summary>
		/// 地暖控制页面
		/// </summary>
		public ExPanelPage heatingPage = null;

		/// <summary>
		/// 背景音乐控制页面
		/// </summary>
		public ExPanelPage bgmPage = null;

		
		public ExPanelPage getExPageByType(ExDeviceType edt)
		{
			if (edt == ExDeviceType.CentralAircon)
				return airconPage;
			else if (edt == ExDeviceType.CentralHeating)
				return heatingPage;
			else if (edt == ExDeviceType.CentralNewWind)
				return newWindPage;
			else if (edt == ExDeviceType.BGM)
				return bgmPage;
			else
				return null;
		}

	}
}
